package com.ruoyi.system.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.StandardNoEs;
import com.ruoyi.system.service.IStandardNoEsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * standardNoesController
 * 
 * @author ruoyi
 * @date 2025-09-11
 */
@RestController
@RequestMapping("/system/standardNoes")
public class StandardNoEsController extends BaseController
{
    @Autowired
    private IStandardNoEsService standardNoEsService;

    /**
     * 查询standardNoes列表
     */
    @PreAuthorize("@ss.hasPermi('system:standardNoes:list')")
    @GetMapping("/list")
    public TableDataInfo list(StandardNoEs standardNoEs)
    {
        startPage();
        List<StandardNoEs> list = standardNoEsService.selectStandardNoEsList(standardNoEs);
        return getDataTable(list);
    }

    /**
     * 导出standardNoes列表
     */
    @PreAuthorize("@ss.hasPermi('system:standardNoes:export')")
    @Log(title = "standardNoes", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, StandardNoEs standardNoEs)
    {
        List<StandardNoEs> list = standardNoEsService.selectStandardNoEsList(standardNoEs);
        ExcelUtil<StandardNoEs> util = new ExcelUtil<StandardNoEs>(StandardNoEs.class);
        util.exportExcel(response, list, "standardNoes数据");
    }

    /**
     * 获取standardNoes详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:standardNoes:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(standardNoEsService.selectStandardNoEsById(id));
    }

    /**
     * 新增standardNoes
     */
    @PreAuthorize("@ss.hasPermi('system:standardNoes:add')")
    @Log(title = "standardNoes", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody StandardNoEs standardNoEs)
    {
        return toAjax(standardNoEsService.insertStandardNoEs(standardNoEs));
    }

    /**
     * 修改standardNoes
     */
    @PreAuthorize("@ss.hasPermi('system:standardNoes:edit')")
    @Log(title = "standardNoes", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody StandardNoEs standardNoEs)
    {
        return toAjax(standardNoEsService.updateStandardNoEs(standardNoEs));
    }

    /**
     * 删除standardNoes
     */
    @PreAuthorize("@ss.hasPermi('system:standardNoes:remove')")
    @Log(title = "standardNoes", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(standardNoEsService.deleteStandardNoEsByIds(ids));
    }
}
